<?php

namespace app\api\model;

use app\common\model\Category;
use app\common\model\User;
use fast\Http;
use think\Exception;
use think\Request;

class Shiti
{

    public $subject = [
        'yuwen'=>[
            'id'=>1,
            'name'=>'语文'
        ],
        'shuxue'=>[
            'id'=>2,
            'name'=>'数学'
        ],
        'yingyu'=>[
            'id'=>3,
            'name'=>'英语'
        ],
        'lishi'=>[
            'id'=>4,
            'name'=>'历史'
        ],
        'dili'=>[
            'id'=>5,
            'name'=>'地理'
        ],
        'zhengzhi'=>[
            'id'=>6,
            'name'=>'政治'
        ],
        'shengwu'=>[
            'id'=>7,
            'name'=>'生物'
        ],
        'huaxue'=>[
            'id'=>9,
            'name'=>'化学'
        ],
        'wuli'=>[
            'id'=>8,
            'name'=>'物理'
        ],
    ];

    public $grade = [
        [
            'id'=>110,
            'name'=>'一年级',
            'level'=>1
        ],
        [
            'id'=>120,
            'name'=>'二年级',
            'level'=>2
        ],
        [
            'id'=>130,
            'name'=>'三年级',
            'level'=>3
        ],
        [
            'id'=>140,
            'name'=>'四年级',
            'level'=>4
        ],
        [
            'id'=>150,
            'name'=>'五年级',
            'level'=>5
        ],
        [
            'id'=>160,
            'name'=>'六年级',
            'level'=>6
        ],
        [
            'id'=>200,
            'name'=>'七年级',
            'level'=>1
        ],
        [
            'id'=>300,
            'name'=>'八年级',
            'level'=>2
        ],
        [
            'id'=>400,
            'name'=>'九年级',
            'level'=>3
        ],
        [
            'id'=>500,
            'name'=>'高一',
            'level'=>1
        ],
        [
            'id'=>600,
            'name'=>'高二',
            'level'=>2
        ],
        [
            'id'=>700,
            'name'=>'高三',
            'level'=>3
        ],
    ];

    //试题搜索
    public function search($keyword,$subject,$user_id,$next)
    {
        $api = "https://www.xuekubao.com/index.php?s=Index&m=Api&a=search";

        $param = [
            'accessKey'=>'5df16e5f946f2aa029e0548f035ec5f0',
            'keyword'=>$keyword,
            //'gradeId'=>'',
            //'subjectId'=>''
        ];
        $user = User::get($user_id);
        if ($user->category_id){
            $category = Category::get($user->category_id);
            $category_name = $category->getAttr('name');
            // 直接在array_keys中使用array_filter
            $searchTerm = $category_name;
            //$searchTerm = substr($category_name,0,9);

            //dump($searchTerm);die;
            $results = array_filter(array_map(function($item) use ($searchTerm) {
                return [
                    'id'=>strtolower($item['id']),
                    'name' => strtolower($item['name']),
                    'level' => strtolower($item['level'])
                ]; // 转换为小写以便于搜索
            }, $this->grade), function($item) use ($searchTerm) {
                return strpos($item['name'], $searchTerm) !== false; // 搜索小写后的字符串
            });

            if (count($results)>0){
                $gradeId = array_values($results)[0]['id'];
                $level = array_values($results)[0]['level'];

                $key = 0;
                /*if ($level==1){
                    throw new Exception('往下已无年级');
                }*/

                if ($next==0){
                    $param['gradeId'] = $gradeId;
                } else {
                    foreach ($this->grade as $k=>$v){
                        if ($v['id']==$gradeId){
                            //$next_gradeId = $v['id'];
                            $key = $k;
                            break;
                        }
                    }
                    if ($key>1){
                        $next_gradeId = $this->grade[$key-$next]['id'];
                        $next_level = $this->grade[$key-$next]['level'];
                        //dump($level);
                        //dump($next_level);
                        if ($level<$next_level){
                            throw new Exception('往下已无年级');
                        }
                        $param['gradeId'] = $next_gradeId;
                    }

                }
            }

        }

        if ($subject){
            $param['subjectId'] = $this->subject[$subject]['id'];
        }

        $data = Http::sendRequest($api,$param,'post');

        if ($data['ret']){
            $res = json_decode($data['msg'], true);
            return json_decode($res['data'], true);
        } else {
            throw new Exception($data['msg']);
        }
    }

    //试题答案
    public function answer($md52)
    {
        $api = "https://www.xuekubao.com/index.php?s=Index&m=Api&a=getAnswer";

        $param = [
            'accessKey'=>'5df16e5f946f2aa029e0548f035ec5f0',
            'qid'=>$md52
        ];

        $data = Http::sendRequest($api,$param,'post');
        $res = json_decode($data['msg'], true);

        return $res['data'];
    }

    public function _json_decode($json_str,$assoc=true){
        return json_decode(urldecode(html_entity_decode($json_str)),$assoc);
    }

    public function print($ids,$topic,$answer,$title,$surplus)
    {
        $api = "http://152.136.133.33:8808/paperdownload-0.0.1-SNAPSHOT/paperdownload/paperDownload/";
        /*$surplus = [
            [
                'id'=>1,
                'title'=>"<p>3厘米=（     ）毫米       （     ）厘米=5分米 </p ><p>3厘米5毫米=（   ）毫米    100毫米=（  ）厘米 </p ><p>40毫米=（   ）厘米         100毫米=（    ）分米 </p ><p>60毫米=（      ）厘米      80厘米=（      ）分米</p ><p>50分米=（      ）米        6米=（      ）厘米=(     )毫米 </p ><p>&#xa0;</p >",
                'md5'=>'08af184a101c9539675a3f566b0e60b7'
            ],
            [
                'id'=>1,
                'title'=>"<p>在○里填上“>”“<”或“=”。</p ><p>3厘米○3分米　　　　5毫米○4厘米　　　　10厘米○1米</p ><p>1米○9分米           7毫米○1分米          10厘米○1分米</p >",
                'md5'=>'82013e5bf64451b36b25e95c1ccdffc1'
            ],
            [
                'id'=>2,
                'title'=>"<p>在○里填上“>”“<”或“=”。</p ><p>3厘米○3分米　　　　5毫米○4厘米　　　　10厘米○1米</p ><p>1米○9分米           7毫米○1分米          10厘米○1分米</p >",
                'md5'=>'82013e5bf64451b36b25e95c1ccdffc1'
            ]
        ];*/
        //dump(json_encode($surplus,320));die;
        $surplus_arr = $this->_json_decode($surplus);
        foreach ($surplus_arr as $k=>$v){
            $surplus_answer = $this->answer($v['md5']);
            if (count($surplus_answer)>0){
                $surplus_arr[$k]['answer'] = $surplus_answer[0]['answer2']?$surplus_answer[0]['answer2']:$surplus_answer[0]['answer1'];
            } else {
                $surplus_arr[$k]['answer'] = '';
            }

        }
        /*$postData = [
            'questionsTypeList'=>[
                [
                    'questionTypeCategory'=>'111',
                    'qtIsSelect'=>1,
                    'questionFristType'=>'单选题',
                    'questionSecondType'=>'',
                    'questionDesc'=>'',
                    'questionTypeNote'=>'',
                    'thisTypeSize'=>4,
                    'questionsList'=>[
                        [
                            'questionContent'=>"在中学生科普知识交流会上，小强这样描述了地球的形状和大小，你认为有误的是（　　）<div> <\/div>",
                            'questionAnswer'=>"<div> D<\/div>",
                            'questionLabelList'=>[
                                [
                                    'labelName'=>'地球形状的认识过程,地球的大小',
                                    'importance'=>1,
                                ]
                            ],
                            'questionSelection'=>"<table><tr><td>A.地球是一个两极稍扁赤道略鼓的不规则球体<\/td><\/tr><tr><td>B.地球表面积约5.1亿平方千米<\/td><\/tr><tr><td>C.地球赤道周长约4万千米<\/td><\/tr><tr><td>D.哥伦布环球航行首次证明地球是一个球体<\/td><\/tr><\/table>",
                            'questionSource'=>'',
                            'questionDifficulty'=>'2.00',
                            'questionAnswerInfo'=>"解：麦哲伦环球航行首次证明地球是一个球体，选项ABC叙述正确，不符合题意。 <br \/>故选：D。 <br \/>现在人们对地球的形状已有了一个明确的认识：地球并不是一个正球体，而是一个两极稍扁，赤道略鼓的不规则球体。经过测量，地球的极半径为6357千米，赤道半径为6378千米，地球的平均半径为6371千米，地球表面积为5.1亿平方千米，最大周长约4万千米。 <br \/>本题考查地球的形状及地球是球体的认识过程，熟记课本知识点解答即可。",

                        ]
                    ]
                ]
            ]
        ];*/
        //dump($postData);
        $postData = [
            'paperStruType'=>'1',
            'mainTitle'=>[
                "mainTitleExist"=>true,
                'mainTitleName'=>$title
            ],
            'subTitle'=>[
                'subTitleName'=>'',
            ],
            //'bindingLine'=>true,
            //'securityMark'=>true,
            //'gradeBar'=>true,
            //'questionAndNotes'=>true,
            //'qGradeBar'=>true,
            'fontSize'=>2,
            //'subjectId'=>1,
            'phaseId'=>1,
            'paperSizeType'=>'A3',
            'answerType'=>1,
            'docType'=>'docx',
            'paperInfoBar'=>[

                'paperInfoBarName'=>''
            ],
            'studentInfoBar'=>[

                'studentInfoBarName'=>''
            ],
            'needingAttention'=>[

                'attention'=>[
                    "",
                    ""
                ]
            ],
            'subPaperAndNotes'=>[

                'notesList'=>[
                    [
                        'title'=>'第I卷（选择题）',
                        'notes'=>'请点击修改第I卷的文字说明'
                    ]
                ]
            ],
            'questionsTypeList'=>[
                [
                    //'questionTypeCategory'=>'111',
                    //'qtIsSelect'=>1,
                    'questionFristType'=>' ',
                    'questionSecondType'=>' ',
                    'questionDesc'=>'',
                    'questionTypeNote'=>'',
                    'thisTypeSize'=>4,
                    /*'questionsList'=>[
                        [
                            'questionContent'=>"在中学生科普知识交流会上，小强这样描述了地球的形状和大小，你认为有误的是（　　）<div> </div>",
                            'questionAnswer'=>"<div> D</div>",
                            'questionLabelList'=>[
                                [
                                    'labelName'=>'地球形状的认识过程,地球的大小',
                                    'importance'=>1,
                                ]
                            ],
                            'questionSelection'=>"<table><tr><td>A.地球是一个两极稍扁赤道略鼓的不规则球体</td></tr><tr><td>B.地球表面积约5.1亿平方千米</td></tr><tr><td>C.地球赤道周长约4万千米</td></tr><tr><td>D.哥伦布环球航行首次证明地球是一个球体</td></tr></table>",
                            'questionSource'=>'',
                            'questionDifficulty'=>'2.00',
                            'questionAnswerInfo'=>"解：麦哲伦环球航行首次证明地球是一个球体，选项ABC叙述正确，不符合题意。 <br/>故选：D。 <br/>现在人们对地球的形状已有了一个明确的认识：地球并不是一个正球体，而是一个两极稍扁，赤道略鼓的不规则球体。经过测量，地球的极半径为6357千米，赤道半径为6378千米，地球的平均半径为6371千米，地球表面积为5.1亿平方千米，最大周长约4万千米。 <br/>本题考查地球的形状及地球是球体的认识过程，熟记课本知识点解答即可。",

                        ],
                        [
                            'questionContent'=>"在中学生科普知识交流是（　　）<div> </div>",
                            'questionAnswer'=>"<div> D</div>",
                            'questionLabelList'=>[
                                [
                                    'labelName'=>'地球形状的认识过程,地球的大小',
                                    'importance'=>1,
                                ]
                            ],
                            'questionSelection'=>"<table><tr><td>A.地球是一个两极稍扁赤道略鼓的不规则球体</td></tr><tr><td>B.地球表面积约5.1亿平方千米</td></tr><tr><td>C.地球赤道周长约4万千米</td></tr><tr><td>D.哥伦布环球航行首次证明地球是一个球体</td></tr></table>",
                            'questionSource'=>'',
                            'questionDifficulty'=>'2.00',
                            'questionAnswerInfo'=>"解：麦哲伦环球航行首次证明地球是一个球体，选项ABC叙述正确，不符合题意。 <br/>故选：D。 <br/>现在人们对地球的形状已有了一个明确的认识：地球并不是一个正球体，而是一个两极稍扁，赤道略鼓的不规则球体。经过测量，地球的极半径为6357千米，赤道半径为6378千米，地球的平均半径为6371千米，地球表面积为5.1亿平方千米，最大周长约4万千米。 <br/>本题考查地球的形状及地球是球体的认识过程，熟记课本知识点解答即可。",

                        ],
                        [
                            'questionContent'=>"在中学生科普知识交流是（　　）<div> </div>",
                            'questionAnswer'=>"<div> D</div>",
                            'questionLabelList'=>[
                            ],
                            'questionSelection'=>"<table><tr><td>A.地球是一个两极稍扁赤道略鼓的不规则球体</td></tr><tr><td>B.地球表面积约5.1亿平方千米</td></tr><tr><td>C.地球赤道周长约4万千米</td></tr><tr><td>D.哥伦布环球航行首次证明地球是一个球体</td></tr></table>",
                            'questionSource'=>'',
                            'questionDifficulty'=>'2.00',
                            'questionAnswerInfo'=>"解：麦哲伦环球航行首次证明地球是一个球体，选项ABC叙述正确，不符合题意。 <br/>故选：D。 <br/>现在人们对地球的形状已有了一个明确的认识：地球并不是一个正球体，而是一个两极稍扁，赤道略鼓的不规则球体。经过测量，地球的极半径为6357千米，赤道半径为6378千米，地球的平均半径为6371千米，地球表面积为5.1亿平方千米，最大周长约4万千米。 <br/>本题考查地球的形状及地球是球体的认识过程，熟记课本知识点解答即可。",

                        ]
                    ]*/
                ]
            ]
        ];
        $list = collection(Cuoti::where('id','in',$ids)->select())->toArray();

        $questionsList = [];
        foreach ($list as $k=>$v){
            $arr = [

                    'questionContent'=>$topic==1?$v['title']:'',
                    'questionAnswer'=>$answer==1?$v['answer']:'',
                    'questionLabelList'=>[],
                    'questionSelection'=>'',
                    'questionSource'=>'',
                    'questionDifficulty'=>'',
                    'questionAnswerInfo'=>"",

            ];
            array_push($questionsList,$arr);
        }
        foreach ($surplus_arr as $kk=>$vv){
            $child_arr = [
                'questionContent'=>$vv['title'],
                'questionAnswer'=>$vv['answer'],
                'questionLabelList'=>[],
                'questionSelection'=>'',
                'questionSource'=>'',
                'questionDifficulty'=>'',
                'questionAnswerInfo'=>"",
            ];
            array_push($questionsList,$child_arr);
        }
        /*$child_arr = [];
        foreach ($surplus_arr as $kk=>$vv){
            $child_arr[] = [
                'questionContent'=>$vv['title'],
                'questionAnswer'=>$vv['answer'],
                'questionLabelList'=>[],
                'questionSelection'=>'',
                'questionSource'=>'',
                'questionDifficulty'=>'',
                'questionAnswerInfo'=>"",
            ];
            $child_arr[] = [
                'questionFristType'=>' ',
                'questionSecondType'=>' ',
                'questionDesc'=>'',
                'questionTypeNote'=>'',
                'thisTypeSize'=>4,
                'questionsList'=>[
                    [
                        'questionContent'=>$vv['title'],
                        'questionAnswer'=>$vv['answer'],
                        'questionLabelList'=>[],
                        'questionSelection'=>'',
                        'questionSource'=>'',
                        'questionDifficulty'=>'',
                        'questionAnswerInfo'=>"",
                    ]
                ]
            ];
        }*/

        $postData['questionsTypeList'][0]['questionsList'] = $questionsList;
        //dump($postData);die;
        $paperData = json_encode($postData);
        //$paperData = '{"questionsTypeList":[{"questionTypeCategory":"111","qtIsSelect":1,"questionFristType":"选择题","questionSecondType":"","questionDesc":"","questionTypeNote":"","thisTypeSize":"4","questionsList":[{"questionContent":"<table border=\"0\"  class=\"ke-zeroborder\">\t<tbody>\t\t<tr>\t\t\t<td>\t\t\t\t<span><\/span>下面图形中，（　　）和（　　）是平行四边形．\t\t\t\t<table style=\"width:650px;\">\t\t\t\t\t<tbody>\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tA．①④\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tB．②⑤\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tC．③⑥\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tD．②⑥\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t<\/tr>\t\t\t\t\t<\/tbody>\t\t\t\t<\/table><br \/><img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao2\/f7c86f40-92fd-11e9-a24f-b42e9921e93e_xkb98.png\" \/>\t\t\t<\/td>\t\t<\/tr>\t<\/tbody><\/table>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>D<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"分类","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"东东有35张画片，欢欢的画片比东东的少得多。欢欢有□张画片。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><DIV align=left><\/DIV>","questionAnswer":"<DIV align=left>C<\/DIV>","questionLabelList":[{"labelName":"100以内的数的认识","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"图<img style=\"WIDTH: 29px; HEIGHT: 30px; VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2012\/110\/xuekubao80\/26b7f7d1-92fe-11e9-9194-b42e9921e93e_xkb20.png\">中有□个三角形。□内应填<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．2<BR>B．3<BR>C．6<BR>D．8","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>D<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"认识图形","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"下面物体不是同类的是<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．<img style=\"VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2011\/110\/xuekubao11\/270cce91-92fe-11e9-99b6-b42e9921e93e_xkb91.gif\"><BR>B．<img style=\"VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2011\/110\/xuekubao22\/270d43c0-92fe-11e9-b8e9-b42e9921e93e_xkb32.gif\"><BR>C．<img style=\"VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2011\/110\/xuekubao53\/270d91de-92fe-11e9-907c-b42e9921e93e_xkb99.gif\"><BR>D．<img style=\"VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2011\/110\/xuekubao20\/270e070f-92fe-11e9-b158-b42e9921e93e_xkb50.gif\">","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>D<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"分类","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"一个杯子3元4角钱，一条毛巾2元7角钱，小健把这两样东西都买了，一共要花了<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A.5元1角<BR>B.6元1角<BR>C.16角<BR>D.5元5角","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"认识人民币及简单的计算","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"一张1元币可以换□张2角币。□内应填<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A.10<BR>B.5<BR>C.2","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"认识人民币及简单的计算","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"小庆买文具盒花了6元7角，下面□种付款方式最简单。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A．1张5元&nbsp;&nbsp;1张1元&nbsp;&nbsp;1张5角&nbsp;&nbsp;l张2角<BR>B．1张2元&nbsp;&nbsp;4张1元&nbsp;&nbsp;1张5角&nbsp;&nbsp;2张1角<BR>C．3张2元&nbsp;&nbsp;7张1角","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"认识人民币及简单的计算","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"下面数中，差是10的是<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．6和4<BR>B．9和1<BR>C．12和2","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>C<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"20以内的减法（退位）","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"哪个算式的得数大？<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．14-2<BR>B．14-4","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"20以内的减法（退位）","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"不计算，得数大的算式是<br\/><div align=right>[&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．15-8<BR>B．15-9","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"20以内的减法（退位）","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"小红有60本故事书，小东有40本故事书，小红的书比小东多多少本？下面算式正确的是<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．60+40=100（本）&nbsp;&nbsp;&nbsp;<BR>B．60-40=20（本）","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"整十数加减整十数","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"爸爸有100元，买牛肉花去30元，买鸡肉花去40元，爸爸还剩多少元？<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．30元<BR>B．40元<BR>C．50元","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"整十数加减整十数","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"三个小朋友比赛跳绳，小丁跳了38下，玲玲跳的比小丁多一些，李云跳的比小丁多得多。（1）玲玲可能跳了<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>（2）李云可能跳了<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A.42下<BR>B.35下<BR>C.75下<BR>D.60下","questionAnswer":"（1）A；（2）C","questionLabelList":[{"labelName":"100以内的数的认识","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<table border=\"0\"  class=\"ke-zeroborder\">\t<tbody>\t\t<tr>\t\t\t<td>\t\t\t\t<span><\/span>4，8，16，32，□，□里应填（　）\t\t\t\t<table style=\"width:650px;\">\t\t\t\t\t<tbody>\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tA．48\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tB．64\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tC．128\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t<\/tr>\t\t\t\t\t<\/tbody>\t\t\t\t<\/table>\t\t\t<\/td>\t\t<\/tr>\t<\/tbody><\/table>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"找规律","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<table border=\"0\"  class=\"ke-zeroborder\">\t<tbody>\t\t<tr>\t\t\t<td>\t\t\t\t<span><\/span>按照规律填上合适的数．<br \/>160，145，130，（　　），100．\t\t\t\t<table style=\"width:650px;\">\t\t\t\t\t<tbody>\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tA．120\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tB．115\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tC．110\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t<\/tr>\t\t\t\t\t<\/tbody>\t\t\t\t<\/table>\t\t\t<\/td>\t\t<\/tr>\t<\/tbody><\/table>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"找规律","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<table border=\"0\"  class=\"ke-zeroborder\">\t<tbody>\t\t<tr>\t\t\t<td>\t\t\t\t<span><\/span>3个4角8分是（　　）\t\t\t\t<table style=\"width:650px;\">\t\t\t\t\t<tbody>\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tA．1元4角4分\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tB．14元4角\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tC．144角\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t<\/tr>\t\t\t\t\t<\/tbody>\t\t\t\t<\/table>\t\t\t<\/td>\t\t<\/tr>\t<\/tbody><\/table>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"认识人民币及简单的计算","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<table border=\"0\"  class=\"ke-zeroborder\">\t<tbody>\t\t<tr>\t\t\t<td>\t\t\t\t<span><\/span>有一列数为1、1、5、13、25、41、…，按此规律排列，第101个数为（　　）\t\t\t\t<table style=\"width:650px;\">\t\t\t\t\t<tbody>\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tA．19801\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tB．19802\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tC．19901\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tD．19902\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t<\/tr>\t\t\t\t\t<\/tbody>\t\t\t\t<\/table>\t\t\t<\/td>\t\t<\/tr>\t<\/tbody><\/table>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"找规律","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"将非零的自然数l，2，3，…按如图格式排列，那么第10行第l0列的数为（　　）<br><img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao69\/79099e21-92ff-11e9-a61a-b42e9921e93e_xkb14.png\" ><table style=\"margin-left:0px;width:650px;\"><tr><td  >A．90<\/td><td  >B．91<\/td><td  >C．109<\/td><td  >D．110<\/td><\/tr><\/table>","questionAnswer":"注意到第一列是完全平方数：1，4，9，16，25，…<br>第1行第1列的数为1<sup>2<\/sup>-0=1，第2行的第2列数为：2<sup>2<\/sup>-1=3，第3行的第3列数为3<sup>2<\/sup>-2=7，…，<br>由此类推第10行第10列数为：10<sup>2<\/sup>-9=91；<br>故选：B．","questionLabelList":[{"labelName":"找规律","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<table border=\"0\"  class=\"ke-zeroborder\">\t<tbody>\t\t<tr>\t\t\t<td>\t\t\t\t<span><\/span>下面物体中，（　　）的形状是圆柱．\t\t\t\t<table style=\"width:650px;\">\t\t\t\t\t<tbody>\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tA．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao72\/5ed5be21-9300-11e9-a3a2-b42e9921e93e_xkb8.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tB．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao69\/5ed7b9ee-9300-11e9-b5e4-b42e9921e93e_xkb56.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tC．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao73\/5ed82f1e-9300-11e9-85ad-b42e9921e93e_xkb35.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tD．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao77\/5ed8f270-9300-11e9-8e3c-b42e9921e93e_xkb76.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t<\/tr>\t\t\t\t\t<\/tbody>\t\t\t\t<\/table>\t\t\t<\/td>\t\t<\/tr>\t<\/tbody><\/table>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"认识图形","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<table border=\"0\"  class=\"ke-zeroborder\">\t<tbody>\t\t<tr>\t\t\t<td>\t\t\t\t<span><\/span>下列图中是圆柱体的是（　　）\t\t\t\t<table style=\"width:650px;\">\t\t\t\t\t<tbody>\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tA．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao75\/5edb154f-9300-11e9-9831-b42e9921e93e_xkb70.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tB．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao73\/5edc4dd1-9300-11e9-ace7-b42e9921e93e_xkb94.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tC．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao24\/5edcc300-9300-11e9-a65a-b42e9921e93e_xkb66.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t\t<td>\t\t\t\t\t\t\t\tD．<img  src=\"http:\/\/img.cuotixue.com\/tikuimages\/2\/2014\/160\/xuekubao98\/5edd382e-9300-11e9-8715-b42e9921e93e_xkb80.png\" \/>\t\t\t\t\t\t\t<\/td>\t\t\t\t\t\t<\/tr>\t\t\t\t\t<\/tbody>\t\t\t\t<\/table>\t\t\t<\/td>\t\t<\/tr>\t<\/tbody><\/table>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"认识图形","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"用“____”把每一组中不同类的词语画出来。<BR>1．蜻蜒　蚂蚁　蜜蜂　蝴蝶花<BR>2．荷花　老牛　壁虎　小白兔<BR>3．燕子　画眉　麻雀　鱼","questionAnswer":"1．蝴蝶花<BR>2．荷花<BR>3．鱼","questionLabelList":[{"labelName":"词语的分类","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"给加粗字选择正确的读音。<BR>1．我们学习雷锋，要有实际<STRONG>行<\/STRONG>（xíng &nbsp;háng）动。<BR>2．他写了一<STRONG>行<\/STRONG>（xíng&nbsp; háng）漂亮的字。<BR>3．银<STRONG>行<\/STRONG>（xíng&nbsp; háng）门口有条人<STRONG>行<\/STRONG>（xíng&nbsp; háng）横道。","questionAnswer":"1．xíng　2．háng　3．háng　xíng","questionLabelList":[{"labelName":"多音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"我能分清它们的读音。在正确拼音下打上“√” <BR>（1）小松鼠长（cháng zhǎng）着一条长（cháng zhǎng）长的尾巴。<BR>（2）听音乐（yuè lè）是一件快乐（yuè lè）的事。<BR>（3）望着（zháo zhe）窗外的大雨，奶奶心里很着（zháo zhe）急。<BR>（4）小明拿来花生种（zhǒng zhòng）子种（zhǒng zhòng）在地里。<BR>（5）东东还（hái huán）有一本书没有还（hái huán）我。","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"多音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<TABLE style=\"WORD-BREAK: break-all\"  cellSpacing=0 ><TBODY><TR><TD>我会读。（用“√”给加粗字选择正确的读音）<BR><TABLE style=\"WIDTH: 543px; HEIGHT: 46px; WORD-BREAK: break-all\"  cellSpacing=0 width=543><TBODY><TR><TD>成<STRONG>为<\/STRONG>（wéi&nbsp; wèi）<BR>树<STRONG>干<\/STRONG>（gān&nbsp; gàn）<\/TD><TD><STRONG>重<\/STRONG>新（chóng&nbsp; zhòng）<BR><STRONG>得<\/STRONG>到（dé&nbsp; de）<\/TD><TD><STRONG>教<\/STRONG>室（jiāo&nbsp; jiào）<BR>立<STRONG>正<\/STRONG>（zhēng&nbsp; zhèng）<\/TD><TD>银<STRONG>行<\/STRONG>（háng&nbsp; xíng）<BR>后<STRONG>背<\/STRONG>（béi&nbsp; bèi）<\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE>","questionAnswer":"成为（wéi√ wèi）　重新（chóng√ zhòng）　教室（jiāo jiào√）　银行（háng√ xíng）<BR>树干（gān gàn√）　得到（dé√ de）　立正（zhēng zhèng√）　后背（bēi bèi√）","questionLabelList":[{"labelName":"多音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"为词语中的加粗字选正确读音。<BR>给：①gěi ②jǐ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 看：①kàn ②kān<BR>送<STRONG>给<\/STRONG>（&nbsp;&nbsp;&nbsp;&nbsp;） <BR>递<STRONG>给<\/STRONG>（&nbsp;&nbsp;&nbsp;&nbsp;） <BR><STRONG>看<\/STRONG>见（&nbsp;&nbsp;&nbsp;&nbsp;） <BR><STRONG>看<\/STRONG>守（&nbsp;&nbsp;&nbsp;&nbsp;） <BR><STRONG>给<\/STRONG>予（&nbsp;&nbsp;&nbsp;&nbsp;） <BR><STRONG>给<\/STRONG>养（&nbsp;&nbsp;&nbsp;&nbsp;） <BR><STRONG>看<\/STRONG>家（&nbsp;&nbsp;&nbsp;&nbsp;） <BR><STRONG>看<\/STRONG>病（&nbsp;&nbsp;&nbsp;&nbsp;）","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"多音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"<TABLE style=\"WORD-BREAK: break-all\" border=0 cellSpacing=0 ><TBODY><TR><TD>给下列多音字选择正确的读音，用“√\"表示。&nbsp; <BR><TABLE style=\"WIDTH: 556px; HEIGHT: 41px; WORD-BREAK: break-all\" border=0 cellSpacing=0 width=556><TBODY><TR><TD>zhī（　）zhǐ （　）只好<BR>dì（　） de（　）大地<\/TD><TD>shǎo（　）shào（　）少女<BR>zháo（　）zhe&nbsp; （　）看着<\/TD><TD>jiào（　）jué（　）睡觉<BR>fā&nbsp;&nbsp; （　）fà&nbsp; （　）头发<\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE>","questionAnswer":"zhǐ&nbsp;　shào　&nbsp;jiào&nbsp;　dì&nbsp;　zhe　&nbsp;fà","questionLabelList":[{"labelName":"多音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"选字填空，把序号写在括号里。 <BR>①朵 ②条 ③杯 ④把 ⑤棵 ⑥座 ⑦拍 ⑧放 ⑨读 ⑩看 <img style=\"MARGIN: 8px 0px; VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao55\/a94dbc30-955a-11e9-ab1c-b42e9921e93e_xkb2.GIF\">踢 <img style=\"MARGIN: 8px 0px; VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao88\/a94f1bc0-955a-11e9-9a72-b42e9921e93e_xkb12.GIF\">洗<BR>一（ 　　）大山 　一（ 　　）雨伞　 一（　　 ）红花<BR>一（ 　　）小树 　一（ 　　）热茶 　一（　　 ）金鱼 <BR>（ 　　）水果 　（ 　　）足球　 （ 　　）电视 <BR>（ 　　）风筝 　（ 　　）儿歌 　（　　 ）皮球","questionAnswer":"⑥④①⑤③②<img style=\"MARGIN: 8px 0px; VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao38\/a9500621-955a-11e9-a0e2-b42e9921e93e_xkb3.GIF\"> <img style=\"MARGIN: 8px 0px; VERTICAL-ALIGN: middle\" src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao56\/a9507b51-955a-11e9-b246-b42e9921e93e_xkb8.GIF\"> ⑩⑧⑨⑦","questionLabelList":[{"labelName":"词语搭配,词性","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"读课文，选正确答案填一填。（只填序号）<BR>1．大雨点要去________。<br\/><P align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/P><br\/>A．有花有草的地方<BR>B．没有花没有草的地方<BR>2．平平要搭很多很多的房子给________。<br\/><P align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/P><br\/>A．自己住　　B．大家住","questionAnswer":"1．B　2．B","questionLabelList":[{"labelName":"课文理解，课文背诵","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"回忆课文内容，选择正确答案。<BR>1．乡亲们在井旁边立了一块石碑，上面刻的字是：<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A．歌唱二小放牛郎<BR>B．吃水不忘挖井人，时刻想念毛主席<BR>2．王二小是一个______的孩子。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A．机智勇敢，不怕牺牲<BR>B．胆小，怕事<BR>3．《画家乡》中，涛涛的家乡在：<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A．平原<BR>B．海边<BR>C．城市","questionAnswer":"1．B <BR>2．A <BR>3．B","questionLabelList":[{"labelName":"课文理解，课文背诵","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"根据课文《小白兔和小灰兔》选一选。<BR>小白兔不跟老山羊要白菜而要菜子，是因为<br\/><div align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/div><br\/>A．老山羊的白菜不好吃 <BR>B．小白兔怕白菜不够吃，不想接 <BR>C．小白兔明白只有自己种，才有吃不完的菜","questionAnswer":"C","questionLabelList":[{"labelName":"课文理解，课文背诵","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"给正确的字涂绿色。<BR>1．<img style=\"WIDTH: 142px; HEIGHT: 51px; VERTICAL-ALIGN: middle\" border=0 src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao81\/ac4ca44f-955a-11e9-90a0-b42e9921e93e_xkb68.gif\" width=169 height=50>　　　　2．<img style=\"WIDTH: 146px; HEIGHT: 52px; VERTICAL-ALIGN: middle\" border=0 src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao15\/ac4f154f-955a-11e9-aa1e-b42e9921e93e_xkb68.gif\" width=147 height=67>","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>B<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"同音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"看图选字，在正确的字上打“√”。<BR>1．<img style=\"VERTICAL-ALIGN: middle\" border=0 src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao92\/ac509bf0-955a-11e9-91a6-b42e9921e93e_xkb97.gif\" width=112 height=75><\/TD><TD>飞（机、鸡）<br\/>2．<img style=\"VERTICAL-ALIGN: middle\" border=0 src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao47\/ac515f40-955a-11e9-99b5-b42e9921e93e_xkb47.gif\" width=111 height=107><\/TD><TD>小（机、鸡）<br\/>3．<img style=\"WIDTH: 114px; HEIGHT: 92px; VERTICAL-ALIGN: middle\" border=0 src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao61\/ac51d46e-955a-11e9-8ff6-b42e9921e93e_xkb15.gif\" width=110 height=89><\/TD><TD>（河、和）水<br\/>4．<img style=\"WIDTH: 117px; HEIGHT: 163px; VERTICAL-ALIGN: middle\" border=0 src=\"http:\/\/img.cuotixue.com\/tikuimages\/1\/2012\/110\/xuekubao14\/ac52499e-955a-11e9-97f1-b42e9921e93e_xkb86.gif\" width=131 height=202><\/TD><TD>我（河、和）你","questionAnswer":"<table style=\"word-break:break-all;\"  ><tr><td>A<\/td><\/tr><\/table>","questionLabelList":[{"labelName":"同音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"读一读，再选词填空。<BR>　　太阳大，地球小，<BR>　　地球绕（rào）着太阳跑。<BR>　　地球大，月亮小，<BR>　　月亮绕（rào）着地球跑。<BR>1．太阳比地球________。（大、小）<BR>2．月亮比地球________。（大、小）","questionAnswer":"1．大　2．小","questionLabelList":[{"labelName":"现代文阅读","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"找出下面书写没有错误的句子。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A、小熊猫在森林里迷路了，它沿着脚印走，就能回到家。<BR>B、荷叶是小水珠的摇蓝。<BR>C、我拔了一个大罗卜。","questionAnswer":"A","questionLabelList":[{"labelName":"汉字的结构","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"选出没有错别字的一句话。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A、我们的生活是辛福的，正天无优无虑。<BR>B、他毫不凝迟地从座位上战了起来。<BR>C、我们要向雷峰那样，勤检节约，坚苦奋斗。","questionAnswer":"C","questionLabelList":[{"labelName":"汉字的结构","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"找一找，找出下面没有写错的一组字。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A、捡贝壳<BR>B、苹原<BR>C、蜜林<BR>D、男该","questionAnswer":"A","questionLabelList":[{"labelName":"汉字的结构","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"找出下面没有错别字的一句话。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A、青晨，朝霞染红了蓝天。<BR>B、丁丁今天带来了一本好看的同话书。<BR>C、讲台上放着一只漂亮的刚笔。<\/TD><\/TR><TR><\/TR><\/TBODY>","questionAnswer":"c","questionLabelList":[{"labelName":"汉字的结构","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"找一找，找出字形书写完全对的一句话。<BR><br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A、大家都责备他，说他不懂得爱户花草。<BR>B、他叫人照曹冲说的办法去做，果然称出了大像的重量。<BR>C、彩蝶纷飞百鸟儿唱，一弯碧水映晚霞。<\/TD><\/TR><TR><\/TR><\/TBODY>","questionAnswer":"C","questionLabelList":[{"labelName":"汉字的结构","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"找出下面书写不对的一个词语。<br\/><DIV align=right>[&nbsp;&nbsp;&nbsp;&nbsp; ]<\/DIV><br\/>A、书本<BR>B、自已<BR>C、今年","questionAnswer":"B","questionLabelList":[{"labelName":"汉字的结构","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""},{"questionContent":"选择合适的字。<BR>1．（爷　父）亲正在看书。<BR>2．我（母　每）天都按时完成作业。<BR>3．叔叔做（事　是）总（是　事）很认真。","questionAnswer":"1．父&nbsp;&nbsp;&nbsp;&nbsp;2．每&nbsp;&nbsp;&nbsp;&nbsp;3．事&nbsp;&nbsp;&nbsp;&nbsp;是","questionLabelList":[{"labelName":"形近字辨析,同音字辨析","importance":1}],"questionSelection":"","questionSource":"","questionDifficulty":"","questionAnswerInfo":""}]}],"paperStruType":"1","mainTitle":{"mainTitleExist":true,"mainTitleName":"2020-07-02小学数学练习试卷"},"subTitle":{"subTitleExist":true,"subTitleName":"试卷副标题"},"bindingLine":true,"securityMark":true,"gradeBar":true,"questionAndNotes":true,"qGradeBar":true,"fontSize":2,"subjectId":"2","phaseId":"1","paperSizeType":"A3","answerType":"1","docType":"doc","paperInfoBar":{"paperInfoBarExist":true,"paperInfoBarName":"考试范围：xxx；考试时间：120分钟；命题人：xxx"},"studentInfoBar":{"studentInfoBarExist":true,"studentInfoBarName":"学校:___________姓名：___________班级：___________考号：___________"},"needingAttention":{"needingAttentionExist":true,"attention":["1、答题前填写好自己的姓名、班级、考号等信息","2、请将答案正确填写在答题卡上"]},"subPaperAndNotes":{"subPaperAndNotesExist":true,"notesList":[{"title":"第I卷（选择题）","notes":"请点击修改第I卷的文字说明"},{"title":"第II卷（非选择题）","notes":"请点击修改第II卷的文字说明"}]}}';

        //dump(json_decode($paperData,true));die;
        $post_data = [
            'docType'=>'docx',
            'answerType'=>'1',
            'fontSize'=>1,
            'paperName'=>'测试',
            'paperData'=>$paperData,
            'paperSizeType'=>"A3",
        ];

        $return_data = send_post($api,$post_data);

        $filePath = $this->getDocumentPath();
        $fileName = $this->getUniqueFileName();
        $save_path = $filePath . $fileName;
        if(!is_dir(ROOT_PATH . 'public/word')) {
            mkdir(ROOT_PATH . 'public/word');
        }
        $fp = fopen($save_path, 'w');
        fwrite($fp, $return_data);
        fclose($fp);
        $request = Request::instance();
        $domain=$request->domain();
        return  str_replace(ROOT_PATH.'public',$domain,$save_path);

    }

    private function getUniqueFileName()
    {
        // 使用日期和时间戳生成唯一文件名
        $fileName = date('Y-m-d_H-i-s') . '_' . uniqid() . '.docx';

        return $fileName;
    }


    /**
     * 获取文档保存路径
     * @return string
     */
    private function getDocumentPath()
    {
        $date = date('Y-m-d');
        $path = ROOT_PATH . 'public/word/' . $date . '/';

        // 确保目录存在，不存在则创建
        if (!is_dir($path)) {
            mkdir($path, 0755, true);
        }

        return $path;
    }
}